package com.jt.service.impl;

import com.jt.dao.StudentMapper;
import com.jt.entity.Student;
import com.jt.service.StudentService;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.print.attribute.standard.PagesPerMinute;
import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public Integer save(Student student) {
        return studentMapper.save(student);
    }

    @Override
    public Student queryById(Integer id) {
        return  studentMapper.queryById(id);
    }

    @Override
    public List<Student> queryPage(RowBounds rowBounds) {
        return studentMapper.queryPage(rowBounds);
    }

    @Override
    public List<Student> queryAll() {
//        PageHelper.startPage(0,5);
        return studentMapper.queryAll();
    }

    @Override
    public List<Student> queryByIds(Integer[] ids) {
        return studentMapper.queryByIds(ids);
    }

    @Override
    public Integer updateStatus(Integer id, Integer status) {
        return studentMapper.updateStatus(id,status);
    }

    @Override
    public List<Student> queryByLike(String sname) {
        return studentMapper.queryByLike(sname);
    }

    @Override
    public Integer update(Student student) {
        return studentMapper.update(student);
    }

}
